package com.atguigu.facade;

/**
 * 成家庭影院项目
 */
public class HomeTheaterFacade {
	
	//定义各个子系统对象
	
	private TheaterLight theaterLight;
	/** 立体声音响 */
	private Stereo stereo;
	/** 放映机 */
	private Projector projector;
	/**  屏幕  */
	private Screen screen;
	private DVDPlayer dVDPlayer;
	
	
	//构造器
	public HomeTheaterFacade() {
		super();
		this.theaterLight = TheaterLight.getInstance();
		this.stereo = Stereo.getInstance();
		this.projector = Projector.getInstance();
		this.screen = Screen.getInstance();
		this.dVDPlayer = DVDPlayer.getInstanc();
	}

	//操作分成 4 步
	/**
	 * 准备
	 */
	public void ready() {
		screen.down();
		projector.on();
		stereo.on();
		dVDPlayer.on();
		theaterLight.dim();
	}
	
	/**
	 * 播入
	 */
	public void play() {
		dVDPlayer.play();
	}
	
	/**
	 * 暂停
	 */
	public void pause() {
		dVDPlayer.pause();
	}
	
	/**
	 * 结束
	 */
	public void end() {
		theaterLight.bright();
		screen.up();
		projector.off();
		stereo.off();
		dVDPlayer.off();
	}
	
}
